package com.wendyxie.sproutup.view

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.wendyxie.sproutup.databinding.ActivityChangeSkinBinding
import com.wendyxie.sproutup.db.SQLInitHelper
import com.wendyxie.sproutup.db.SQLTreeHelper
import com.wendyxie.sproutup.view.adapter.ChangeSkinAdapter

class ChangeSkinActivity : AppCompatActivity() {

    private lateinit var binding: ActivityChangeSkinBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivityChangeSkinBinding.inflate(layoutInflater)
        setContentView(binding.root)

        // GridView的显示
        val adatper = ChangeSkinAdapter()
        binding.gvTree.adapter = adatper
        val scores = SQLTreeHelper.queryAllTrees(SQLInitHelper(this).openDatabase())
        adatper.setItems(scores)
    }

}
